package cc.lucien.service;

import cc.lucien.entity.GoodType;
import cc.lucien.entity.Role;
import cc.lucien.repository.GoodTypeRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodTypeService {

    @Autowired
    private GoodTypeRepository goodTypeRepository;

    public List<GoodType> findAll() {
        return goodTypeRepository.findAll();
    }

    public Role findById(Integer id) {
        return goodTypeRepository.findById(id);
    }

    public int save(GoodType goodType) {
        return goodTypeRepository.save(goodType);
    }

    public int update(GoodType goodType) {
        return goodTypeRepository.update(goodType);
    }

    public int deleteById(Integer id) {
        return goodTypeRepository.deleteById(id);
    }
}
